import { parseString } from "../utils/float";

export function parseWeight(weight: number | string) {
	const weightNum = parseString(weight);
	if (
		typeof weight === "string" &&
		weight.includes("斤") &&
		!weight.includes("公斤")
	) {
		return weightNum / 2;
	}

	return weightNum;
}
